home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-09-27 | 2.2 KB | 66 lines | [TEXT/ttxt] |
- #!/bin/csh
- #
- # savesys -- build a saved executable in bin/new-lispworks-haskell
- #
- #
- cd $Y2
- setenv PRELUDEBIN $Y2/progs/prelude/lispworks
- if !(-e $PRELUDEBIN/Prelude.wfasl) then
- echo "Build the prelude first, stupid..."
- exit
- endif
- $LISPWORKS <<EOF
- ;;; Load the Haskell system.
- (load "com/lispworks/patches/safe-fo-closure.wfasl")
- (make-package "MUMBLE-IMPLEMENTATION" :use '("LISP"))
- (load "cl-support/cl-init")
- ;;; Set various internal switches to appropriate values for running
- ;;; Haskell code.
- (proclaim '(optimize (speed 3) (safety 0) (compilation-speed 0)))
- (setf *load-verbose* nil)
- (setf *compile-verbose* nil)
- (in-package :mumble-user)
- (setf *printers* '(compiling loading prompt))
- (setf *compile-interface* '#f)
- ;;; Load the prelude
- (compile/load *prelude-unit-filename*)
- ;;; Set up the saved system.
- (setf *modules-loaded* '())
- (define (haskell-toplevel)
- ;; Need to reset pathname defaults
- (setf lisp:*default-pathname-defaults* (lisp:truename ""))
- (use-vanilla-interface)
- (load-init-files)
- (let ((args (cdr sys::*line-argument-list*)))
- (if (null? args)
- (do () ('#f)
- (lisp:with-simple-restart (restart-haskell "Restart Haskell.")
- (heval)))
- (lisp:with-simple-restart (restart-haskell "Exit Haskell.")
- (hrun (car args) (cdr args))))))
- (define (restart-haskell)
- (lisp:invoke-restart 'restart-haskell))
- (define (haskell-debugger-hook c f)
- (declare (ignore f))
- (if *haskell-debug-in-lisp*
- (begin
- (when *haskell-enter-debugger-hook*
- (funcall *haskell-enter-debugger-hook*))
- (lisp:unwind-protect (lisp:invoke-debugger c)
- (when *haskell-exit-debugger-hook*
- (funcall *haskell-exit-debugger-hook*))))
- (begin
- (format '#t "Lisp error:~%~a~%" c)
- (haskell-backtrace)
- (when *haskell-compilation-error-hook*
- (funcall *haskell-compilation-error-hook*))
- (format '#t "Restarting Haskell...~%")
- (restart-haskell))))
- (setf lisp:*debugger-hook* (function haskell-debugger-hook))
- (lw:save-image "bin/new-lispworks-haskell"
- :gc '#t
- :normal-gc '#f ; don't reset gc parameters
- :restart-function 'haskell-toplevel)
- (lw:bye)
- EOF
-